//
//  PrizeViewController.m
//  wtshoppingcite
//
//  Created by TW on 15/5/27.
//  Copyright (c) 2015年 TW. All rights reserved.
//

#import "PrizeViewController.h"

@interface PrizeViewController ()<UIScrollViewDelegate>
@end

@implementation PrizeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setTitleView:@"中奖了"];
    
    UIImageView *bg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight)];
    [bg setImageWithURL:[NSURL URLWithString:_adv]];
//    bg.contentMode = UIViewContentModeScaleAspectFit;
    self.view = bg;
    
    [self initWithHeadView];

}

#pragma mark 中奖界面
-(void)initWithHeadView{
    
    
    
    UIView *headView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kWidth, kHeight/2)];
    [self.view addSubview:headView];
    
    UILabel *titleLabel = [self createLabelWithFrame:CGRectMake(0, 10, kWidth, 40) text:[NSString stringWithFormat:@"恭喜您抽到了%@等奖",_prizeModel.prizeId] font:28.0f textAli:NSTextAlignmentCenter textColor:MAIN_BLUE_COLOR];
    [headView addSubview:titleLabel];
    
    
    UILabel *subTitleLabel = [self createLabelWithFrame:CGRectMake(0, titleLabel.bottom, kWidth, 40) text:[NSString stringWithFormat:@"%@%@%@",_prizeModel.prizeName,_prizeModel.amount,_prizeModel.unit] font:18.0f textAli:NSTextAlignmentCenter textColor:MAIN_BLUE_COLOR];
    [headView addSubview:subTitleLabel];
    
    
//    UIScrollView *mainScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, headView.bottom, kWidth, kHeight - headView.height)];
//    mainScrollView.showsHorizontalScrollIndicator = NO;
//    mainScrollView.showsVerticalScrollIndicator = NO;
//    mainScrollView.backgroundColor = COLOR_RGB(228, 229, 228);
//    mainScrollView.contentSize = CGSizeMake(imageArr.count * kWidth, 0);
//    mainScrollView.showsHorizontalScrollIndicator = NO;
//    mainScrollView.pagingEnabled = YES;
//    mainScrollView.delegate = self;
//    [self.view addSubview:mainScrollView];
//    
//    
//    UIPageControl  *pageControl = [[UIPageControl alloc] init];
//    pageControl.frame = CGRectMake((kWidth -120)/2, 200-20, 120, 10);
//    pageControl.numberOfPages = imageArr.count;
//    pageControl.enabled = NO;
//    pageControl.currentPage = 0;
//    [mainScrollView addSubview:pageControl];
//    
//    for (int i = 0; i< imageArr.count; i++) {
//        UIImageView *imageView = [[UIImageView alloc] init];
//        imageView.frame = CGRectMake(i * kWidth, 0, kWidth, kHeight - headView.height);
//        // 2.设置图片
//        NSString *imgName = [NSString stringWithFormat:@"%@", imageArr[i]];
//        imageView.image = [UIImage imageNamed:imgName];
//        [imageView setImageWithURL:[NSURL URLWithString:imgName] placeholderImage:[UIImage imageNamed:@"imagePath_default"]];
//        [mainScrollView addSubview:imageView];
//        
//    }

}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
